<%@ page contentType="text/html;charset=UTF-8"  %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/css/admin.css">
    <script src="https://cdn.bootcss.com/jquery/1.11.1/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/admin/js/pintuer.js"></script>
    <script>
        function upData(id) {
            var title = $("#intr_title" + id).val();
            var content = $("#intr_content" + id).val();
            if(confirm('确认修改?')) {
                location.href = '${pageContext.request.contextPath}/IntroductionServlet?method=updataAdminIntroduction&id=' + id + '&title=' + title + '&content=' + content;
            }
        }
    </script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 公司简介</strong></div>
    <table class="table table-hover text-center">
        <tr>
            <th width="5%">ID</th>
            <th>标题</th>
            <th>字段</th>
            <th width="250">操作</th>
        </tr>
        <c:forEach items="${introduction}" var="introductions">
            <tr>
                <%--获取到数据库里的对应的id--%>
                <td id="intr_id">${introductions.id}</td>
                    <%--通过增加id来区分每条信息--%>
                <td><input type="text" class="input" name="stitle" id="intr_title${introductions.id}" value="<c:out value="${introductions.title}"></c:out>" /></td>
                <td><input type="text" class="input" name="stitle" id="intr_content${introductions.id}" value="<c:out value="${introductions.content}"></c:out>" /></td>
                <td>
                    <div class="button-group">
                        <a id="click" class="button border-main" href="javascript:void(0)"
                           onclick="upData(${introductions.id})">
                            <span class="icon-edit"></span>修改
                        </a>
                    </div>
                </td>
            </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>

